FROM hadoop:3.3.1
MAINTAINER qpwu wqp0010@gmail.com

ARG HBASE_VERSION=2.4.8

ENV PATH $PATH:/hbase/bin

ENV JAVA_HOME=/usr/local/openjdk-8/

LABEL Description="HBase" \
      "HBase Version"="$HBASE_VERSION"

WORKDIR /

#更改时区
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
        && echo "Asia/Shanghai" > /etc/timezone

# Install hbase
RUN mkdir -p "hbase-$HBASE_VERSION" \
  && export ARCHIVE=hbase-$HBASE_VERSION-bin.tar.gz \
  && export DOWNLOAD_PATH=apache/hbase/$HBASE_VERSION/$ARCHIVE \
  && curl -sSL https://mirrors.bfsu.edu.cn/$DOWNLOAD_PATH | \
    tar -xz -C "hbase-$HBASE_VERSION" --strip-components 1 \
  && ln -sv "hbase-$HBASE_VERSION" hbase \
  && rm -rf $ARCHIVE \
  && mkdir -p /hbase-data

VOLUME /hbase-data

COPY entrypoint.sh /
COPY conf/hbase-site.xml /hbase/conf/
COPY conf/core-site.xml /usr/local/hadoop-3.3.1/etc/hadoop/
COPY conf/hdfs-site.xml /usr/local/hadoop-3.3.1/etc/hadoop/
COPY profile.d/java.sh /etc/profile.d/

RUN apt-get -y install net-tools vim

# Stargate  8080  / 8085
# Thrift    9090  / 9095
# HMaster   16000 / 16010
# RS        16201 / 16301
EXPOSE 2181 8080 8085 9090 9095 16000 16010 16030 16201 16301

ENTRYPOINT ["/entrypoint.sh"]